<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/12/12
 * Time: 9:02
 */

namespace app\admin\model;



use traits\model\SoftDelete;

class CaseDetails extends Base
{
    use SoftDelete;

    protected $autoWriteTimestamp = 'datetime';

    public function getStatusAttr($value)
    {
        $status = [1=>'应用',2=>'禁用'];
        return $status[$value];
    }

    public function getIsGroomAttr($value){
        $status = [1=>'是',2=>'否'];
        return $status[$value];
    }

    public function caseCategory(){
        return $this->belongsTo('case_category','category','id');
    }

    public function caseInfo()
    {
        return $this->hasOne('CaseInfo','details_id');
    }
}